*Use dataset: Replication Data_Military Experience and the Use of Force_AUMF votes.dta


*Graphics in paper uses color scheme prior to Stata 18, command:
set scheme s2color

*********************************************
****VETERAN REGRESSION MODELS (Table 4)****
*********************************************
xtset idNum
***Specification 1: Party
xtreg vote veteran oppPartyPres democrat if congress != 1072, vce(cluster idNum) 
***Specification 2: Ideology
xtreg vote veteran oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)


*********************************************
****MAIN REGRESSION MODELS (Table 5)****
*********************************************
xtset idNum
***Specification 1: Party
xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress != 1072, vce(cluster idNum) 
***Specification 2: Ideology
xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)


*********************************************
****HETERGENEOUS EFFECTS - Party of the President and Combat Deployment Status (Figure 2 / Table A-3 in Appendix A.11)****
*********************************************
gen samePartyPres = 0
replace samePartyPres = 1 if oppPartyPres == 0
 xtreg vote c.combatVet#c.samePartyPres c.nonCombatVet#c.samePartyPres c.combatVet#c.oppPartyPres c.nonCombatVet#c.oppPartyPres oppPartyPres if congress != 1072, vce(cluster idNum)
outreg2 using interactionTable.xls, replace ctitle(AUMF Vote)

*Replicate Figure 1:
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Interaction: Copartisan of President & Combat Status}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.39", span) coeflabels(c.combatVet#c.samePartyPres = "Copartisan Combat Vet" c.nonCombatVet#c.samePartyPres = "Copartisan Non-Combat Vet" c.combatVet#c.oppPartyPres = "Outpartisan Combat Vet" c.nonCombatVet#c.oppPartyPres = "Outpartisan Non-Combat Vet")
drop samePartyPres


*********************************************
****ROBSUTNESS CHECKS (Figures 3 / Table A-4 in Appendix A.12)****
*********************************************

***(1)Southern Military Tradition
xtreg vote combatVet nonCombatVet oppPartyPres south firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store south_plot

***(2)Length of Military Service
xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom totalServiceLength if congress != 1072, vce(cluster idNum)
estimates store len_serv
xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom totalServiceLength serviceLengthSQR if congress != 1072, vce(cluster idNum)
xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom log_service if congress != 1072, vce(cluster idNum)

*Replicate Figure 3:
quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store main
coefplot (main, label(Primary Specification)) (south_plot, label(Southern Status)) (len_serv, label(Length of Service)), keep(combatVet nonCombatVet) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g)  mlabposition(12) mlabgap(*1) title("{bf:Robustness of Point Estimates}", span) xtitle("Probability of Affirmative Vote") legend(rows(1) span)
**Alternate view of Robustness Checks and full results in a table view provided in Appendix A.12

drop _est_south_plot _est_len_serv _est_main 


*********************************************
****Appendix A.1 Veteran Status Impact on AUMF Voting Behavior****
*********************************************
*Replicate Figure A.1
quietly xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress != 1072, vce(cluster idNum)
estimates store party
quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store ideology
coefplot (party, label(Party Affiliation)) (ideology, label(Ideology)), drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.2g) mlabposition(3) mlabgap(*6) title("{bf:Veteran Status Impact on AUMF Voting Behavior}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.41 (Party)/0.43 (Ideology)", span) coeflabels(firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks" democrat = "Democrat")
drop _est_party


*********************************************
****Appendix A.4 Results with 2001 AUMF Included ****
*********************************************

regress vote combatVet nonCombatVet oppPartyPres if congress == 1072, robust
*Replicate Figure A.2
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) keep(*:) mlabel format(%12.2g) mlabposition(2) mlabgap(*2) title("{bf:Afghanistan AUMF Vote}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 421  {&bull}  R-Squared 0.003", span) 

xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom, vce(cluster idNum)
estimates store inclAFG
*Replicate Figure A.3
coefplot (inclAFG, label(Includes AFG AUMF Vote)) (ideology, label(Main Specification)), drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.2g) mlabposition(3) mlabgap(*6) title("{bf:Comparative Results} Including Afghanistan AUMF Vote", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Including Afghanistan Vote  {&bull}  N = 2,958  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.358" "GLS Regression Excluding Afghanistan Vote  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.427", span) coeflabels(firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks")
drop _est_inclAFG


*********************************************
****Appendix A.5 Modeling Each AUMF Vote Separately****
*********************************************
regress vote combatVet nonCombatVet oppPartyPres if congress == 98, robust
estimates store lebanon
regress vote combatVet nonCombatVet oppPartyPres if congress == 102, robust
estimates store persianGulf
regress vote combatVet nonCombatVet oppPartyPres if congress == 103, robust
estimates store somalia
regress vote combatVet nonCombatVet oppPartyPres if congress == 106, robust
estimates store kosovo
regress vote combatVet nonCombatVet oppPartyPres if congress == 107, robust
estimates store iraq
regress vote combatVet nonCombatVet oppPartyPres if congress == 112, robust
estimates store libya
*Replicate Figure A.4
coefplot lebanon || persianGulf || somalia || kosovo || iraq || libya, drop(_cons) xline(0) ciopts(recast(rcap)) keep(*:) mlabel format(%12.2g) mlabposition(2) mlabgap(*2) bylabels("1983 Lebanon" "1991 Persian Gulf" "1993 Somalia" "1999 Kosovo" "2002 Iraq" "2011 Libya")
drop _est_lebanon _est_persianGulf _est_somalia _est_kosovo _est_iraq _est_libya

******Compare results grouping voting behavior between "realpolitik" conflicts [102 - Persian Gulf War & 107 Iraq] versus intrastate security concerns [98 - Lebanon, 103 - Somalia, 106 - Kosovo, 112 - Libya]
xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress == 107 | congress == 102, vce(cluster idNum)
estimates store AUMF_realP
xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress != 107 & congress != 102 & congress != 1072, vce(cluster idNum)
estimates store AUMF_hum

*Replicate Figure A.5
coefplot AUMF_realP|| AUMF_hum, drop(_cons) xline(0) ciopts(recast(rcap)) keep(*:) mlabel format(%12.2g) mlabposition(2) mlabgap(*3) mlabsize(medsmall) bylabels("Realpolitik" "Humanitarian/Intrastate" ) 
drop _est_AUMF_realP _est_AUMF_hum


*********************************************
****Appendix A.6 Modeling Deployment Conflicts Separately****
*********************************************
*(1) Model veterans of wartime conflicts separately
label variable WWII "Wartime Deployment"
xtreg vote WWII oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store wwII

xtreg vote Vietnam oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store vietnam

xtreg vote Korea oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store korea

xtreg vote PersianGulfWar oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store persianG

xtreg vote GWOT oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store gwot

*Replicate Figure A.6
coefplot (wwII, label(WWII Vets)) (vietnam, label(Vietnam Vets)) (korea, label(Korea Vets)) (persianG, label(Persian Gulf Vets)) (gwot, label(GWOT Vets)), drop(_cons) xline(0) rename(Vietnam = WWII Korea = WWII PersianGulfWar = WWII GWOT = WWII) ciopts(recast(rcap)) title("{bf:Separate Results by Deployment Conflict}", span) xtitle("Probability of Affirmative Vote") coeflabels(firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks") legend (rows(2) span)
label variable WWII "Wartime Deployment - WWII"
drop _est_wwII _est_vietnam _est_korea _est_persianG _est_gwot



*(2) Regression Model Separating out effect of conflict of combat deployment 
xtreg vote WWII Vietnam Korea PersianGulfWar GWOT nonCombatVet oppPartyPres firstDWNom secondDWNom  if congress != 1072, vce(cluster idNum)

*Replicate Figure A.7
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Differential Impact of Conflict of Deployment}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.428", span) coeflabels(firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks")



*(3) Regression Model Separating out effect of success or failure of Conflict 
xtreg vote winningVets nonwinningvets nonCombatVet oppPartyPres democrat if congress != 1072, vce(cluster idNum)

*Replicate Figure A.8
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Differential Impact of Successful Conflict Participation}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,529  {&bull}  Clusters: 1,156  {&bull}  R-Squared 0.41"  "Successful Conflicts include WWII & Gulf War; Unsuccessful Conflicts include Korea, Vietnam, and GWOT", span) coeflabels(winningVets = "Successful Conflict" nonwinningvets = "Unsuccessful Conflict")


*********************************************
****Appendix A.7 Effects of Direct Combat Exposure****
*********************************************
xtreg vote inCombat nearCombat unkCombat nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)

*Replicate Figure A.9
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Incorporating Combat Exposure Effects}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.428", span) coeflabels(inCombat = "Direct Combat Exposure" nearCombat = "No Direct Combat Exposure" unkCombat = "Unknown Combat Exposure" firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks")


*********************************************
****Appendix A.8 Party & Combat Status Interaction****
*********************************************
gen republican = 0
replace republican = 1 if democrat == 0
xtreg vote c.combatVet#c.democrat c.nonCombatVet#c.democrat c.combatVet#c.republican c.nonCombatVet#c.republican oppPartyPres democrat if congress != 1072, vce(cluster idNum)

*Replicate Figure A.10
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Interaction: Party & Combat Status}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.413", span) coeflabels(c.combatVet#c.democrat = "Democrat Combat Vet" c.nonCombatVet#c.democrat = "Democrat Non-Combat Vet" c.combatVet#c.republican = "Republican Combat Vet" c.nonCombatVet#c.republican = "Republican Non-Combat Vet")
drop republican


*********************************************
****Appendix A.9 Service Branch & Combat Status Interaction****
*********************************************
xtreg vote c.Army#c.combatVet c.AirForce#c.combatVet c.Navy#c.combatVet c.MarineCorps#c.combatVet c.CoastGuard#c.combatVet c.ReservesNG#c.combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom  if congress != 1072, vce(cluster idNum)

*Replicate Figure A.11
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Interaction: Service Branch & Combat Deployment}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.427", span) coeflabels(c.Army#c.combatVet = "Army Combat Vet" c.AirForce#c.combatVet = "Air Force Combat Vet" c.Navy#c.combatVet = "Navy Combat Vet" c.MarineCorps#c.combatVet = "Marine Corps Combat Vet" c.CoastGuard#c.combatVet = "Coast Guard Combat Vet" c.ReservesNG#c.combatVet = "Reserve/NG Combat Vet" firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks")


*********************************************
****Appendix A.10 Southern & Combat Status Interaction****
*********************************************
gen not_South = 0
replace not_South = 1 if south == 0
xtreg vote c.combatVet#c.south c.nonCombatVet#c.south c.combatVet#c.not_South c.nonCombatVet#c.not_South oppPartyPres firstDWNom secondDWNom  if congress != 1072, vce(cluster idNum)

*Replicate Figure A.12
coefplot, drop(_cons) xline(0) ciopts(recast(rcap)) mlabel format(%12.3g) mlabposition(12) mlabgap(*2) title("{bf:Interaction: Southern & Combat Status}", span) subtitle("{it:95% Confidence Intervals}", span) xtitle("Probability of Affirmative Vote") note("GLS Regression Results  {&bull}  N = 2,537  {&bull}  Clusters: 1,161  {&bull}  R-Squared 0.429", span) coeflabels(c.combatVet#c.south = "Southern Rep Combat Vet" c.nonCombatVet#c.south= "Southern Rep Non-Combat Vet" c.combatVet#c.not_South = "Non-Southern Rep Combat Vet" c.nonCombatVet#c.not_South = "Non-Southern Rep non-Combat Vet" firstDWNom = "Partisan Extremism" secondDWNom = "Partisan Mavericks")
drop not_South


*********************************************
****Appendix A.12 Robustness Checks Full Results Table****
*********************************************

quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
outreg2 using robustnessChecks.xls, replace ctitle(Main Specification)

quietly xtreg vote combatVet nonCombatVet oppPartyPres south firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
outreg2 using robustnessChecks.xls, append ctitle(Southern Status)

quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom totalServiceLength if congress != 1072, vce(cluster idNum)
outreg2 using robustnessChecks.xls, append ctitle(Length of Service)


*********************************************
****Appendix A.13 Alternate clustering method by Congress****
*********************************************
xtset idNum
quietly xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress != 1072, vce(cluster idNum) 
estimates store originalParty
outreg2 using RegressionClusters.xls, replace ctitle(AUMF Vote)
quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster idNum)
estimates store originalIdeology
outreg2 using RegressionClusters.xls, append ctitle(AUMF Vote)

xtset congress
quietly xtreg vote combatVet nonCombatVet oppPartyPres democrat if congress != 1072, vce(cluster congress) 
estimates store newParty
outreg2 using RegressionClusters.xls, append ctitle(AUMF Vote)
quietly xtreg vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom if congress != 1072, vce(cluster congress)
estimates store newIdeol
outreg2 using RegressionClusters.xls, append ctitle(AUMF Vote)

*reset clustering by Congress member
xtset idNum


*********************************************
****Appendix A.14 Results using Logit and Probit Models****
*********************************************
quietly logit vote combatVet nonCombatVet oppPartyPres democrat, vce(cluster idNum)
outreg2 using logitprobit.xls, replace ctitle(logit)
quietly probit vote combatVet nonCombatVet oppPartyPres democrat, vce(cluster idNum)
outreg2 using logitprobit.xls, append ctitle(probit)
margins, dydx(combatVet nonCombatVet oppPartyPres democrat)
 
quietly logit vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom, vce(cluster idNum)
outreg2 using logitprobit.xls, append ctitle(logit)
quietly probit vote combatVet nonCombatVet oppPartyPres firstDWNom secondDWNom, vce(cluster idNum)
outreg2 using logitprobit.xls, append ctitle(probit)
margins, dydx(combatVet nonCombatVet oppPartyPres)


*********************************************
****Appendix A.16 Directly Comparing Combat and Non-Combat Veteran AUMF Voting Behavior****
*********************************************
xtreg vote combatVet oppPartyPres democrat if congress != 1072 & onlyVets == 1, vce(cluster idNum)
xtreg vote combatVet oppPartyPres firstDWNom secondDWNom if congress != 1072 & onlyVets == 1, vce(cluster idNum)
